package com.raycloud.controller;

/**
 * Created by donar on 17/2/28.
 */
public class Response {
    Boolean success;
    String errorMsg;
    Object data;

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
    public static Response error(String errorMsg){
        Response response = new Response();
        response.setSuccess(false);
        response.setErrorMsg(errorMsg);
        return response;
    }
    public static Response success(Object data){
        Response response = new Response();
        response.setSuccess(true);
        response.setData(data);
        return response;
    }
}
